import type { Metadata } from "next";
import localFont from "next/font/local";
import "./globals.css";
import { RouteChangeProgress } from '@/components/RouteChangeProgress';
import { Suspense } from 'react';
import { DelayedContent } from '@/components/DelayedContent';
import ClientLayout from './clientLayout';

const geistSans = localFont({
  src: "./fonts/GeistVF.woff",
  variable: "--font-geist-sans",
  weight: "100 900",
});
const geistMono = localFont({
  src: "./fonts/GeistMonoVF.woff",
  variable: "--font-geist-mono",
  weight: "100 900",
});

export const metadata: Metadata = {
  title: "Create Next App",
  description: "Generated by create next app",
};

export default function RootLayout({
  children,
}: Readonly<{
  children: React.ReactNode;
}>) {
  return (
    <html lang="en">
      <head>
        <style>{`
          #nprogress .bar {
            background: #1890ff !important;
            height: 3px !important;
          }
          
          #nprogress .peg {
            box-shadow: 0 0 10px #1890ff, 0 0 5px #1890ff !important;
          }
        `}</style>
      </head>
      <body className={`${geistSans.variable} ${geistMono.variable} antialiased`}>
        <RouteChangeProgress />
        <Suspense>
          <DelayedContent>
            <ClientLayout>
              {children}
            </ClientLayout>
          </DelayedContent>
        </Suspense>
      </body>
    </html>
  );
}